//
//  ViewController.m
//  SandBoxDemo
//
//  Created by UniHan_iMac on 17/3/31.
//  Copyright © 2017年 UniHan_iMac. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // 沙盒根目录
    NSHomeDirectory();
    
    // 沙盒Documents文件夹目录
    [NSString stringWithFormat:@"%@/Documents",NSHomeDirectory()];
    [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];
    NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    
    // 沙盒Library文件夹目录
    [NSString stringWithFormat:@"%@/Library",NSHomeDirectory()];
    [NSHomeDirectory() stringByAppendingPathComponent:@"Library"];
    NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES);
    
    // 沙盒tmp文件夹目录
    NSTemporaryDirectory();
    
    // 将图片存入沙盒
    [[NSBundle mainBundle] pathForResource:@"duck" ofType:@"png"];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
